<?php 
require_once('../../include/top.php');


$db = Database::getInstance();

$sql = "SELECT * FROM shout ORDER BY date desc";

foreach($db->fetch($sql) as $result)
{
	if($result['url']!='')
	{
		$nom = '<a href="'.$result['url'].'" target="_blank">'.$result['name'].'</a>';
	}
	else
	{
		$nom = $result['name'];
	}
	echo '
	<div>
		<img src="'.MEDIA_PATH.'img/comment.jpg"/>
		<p class="comm"><span>'.$nom.'</span> a écrit le '.gmdate('j.m.Y', strtotime($result['date'])).' à '.gmdate('H\hi', strtotime($result['date'])).' :</p>
		<p>'.$result['content'].'</p>
		
	</div>
	';
}


?>

